package com.icedevcloud.upms.controller.admin.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * <p>
 * 添加用户ReqDto
 * </p>
 *
 * @author dengbing
 * @since 2023-08-13
 */
@Schema(name = "添加用户ReqDto")
@Data
public class AddUserReqDto {

    @Size(min = 5, max = 20, message = "用户名长度必须在5-20之间")
    @NotBlank(message = "用户名不能为空")
    @Schema(description = "用户名")
    private String username;

    @Size(max = 32, message = "密码长度不能超过32位")
    @Schema(description = "密码")
    private String password;

    @Size(min = 2, max = 32, message = "昵称长度必须在2-20之间")
    @NotBlank(message = "昵称不能为空")
    @Schema(description = "昵称")
    private String nickname;

    @Size(max = 255, message = "头像长度不能超过255位")
    @Schema(description = "头像")
    private String avatar;

    @Max(value = 1, message = "状态只能为 (1-正常 0-禁用)")
    @Min(value = 0, message = "状态只能为 (1-正常 0-禁用)")
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态 1-启用 0-禁用")
    private Integer status;

    @NotBlank(message = "手机号不能为空")
    @Schema(description = "手机号")
    private String phone;

    @Email(message = "邮箱格式不正确")
    @NotBlank
    @Schema(description = "邮箱")
    private String email;

    @NotNull(message = "角色ID不能为空")
    @Schema(description = "角色ID")
    private Long roleId;

    @NotNull(message = "部门ID不能为空")
    @Schema(description = "部门ID")
    private Long deptId;

}
